﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="UserProperty.aspx.cs" Inherits="FreeProperty.Views.User.UserProperty" %>

<form id="frmContent" runat="server">
<script language="javascript">
    function ChangeProfile(isChangeProfile) {
        var tbName = document.getElementById('<%=tbName.ClientID%>');
        var tbPhoneNo = document.getElementById('<%=tbPhoneNo.ClientID%>');
        var tbPassword = document.getElementById('<%=tbPassword.ClientID%>');

        var lblPassword = document.getElementById('<%=lblPassword.ClientID%>');
        var lblName = document.getElementById('<%=lblName.ClientID%>');
        var lblPhoneNo = document.getElementById('<%=lblPhoneNo.ClientID%>');

        var btnChange = document.getElementById('btnChange');
        var btnSaveProfile = document.getElementById('btnSaveProfile');
        var btnCancel = document.getElementById('btnCancel');

        if (isChangeProfile) {
            tbName.value = lblName.innerHTML;
            tbPassword.value = lblPassword.innerHTML;
            tbPhoneNo.value = lblPhoneNo.innerHTML;

            tbName.style.display = tbPhoneNo.style.display = tbPassword.style.display = "";
            lblName.style.display = lblPhoneNo.style.display = lblPassword.style.display = "none";
            btnChange.style.display = "none";
            btnCancel.style.display = btnSaveProfile.style.display = "";
        }
        else {
            tbName.style.display = tbPhoneNo.style.display = tbPassword.style.display = "none";
            lblName.style.display = lblPhoneNo.style.display = lblPassword.style.display = "";
            btnChange.style.display = "";
            btnCancel.style.display = btnSaveProfile.style.display = "none";

        }
        return false;
    }
    function ShowHideProfile() {
        $('#User_Profile_Area').slideToggle('slow');
    }
</script>
<h2>
    User Property</h2>
<div id="MainContainer">
    <asp:hiddenfield id="hdnMode" runat="server" />
    <asp:hiddenfield id="hdnUserID" runat="server" />
    <asp:hiddenfield id="hdnPageCount" runat="server" />
    <asp:hiddenfield id="hdnCurrentPage" runat="server" />
    <asp:hiddenfield id="hdnSelectedPane" runat="server" />
    <asp:hiddenfield id="hdnStatus" runat="server" />
    <div>
        <a onclick="javascript:ShowHideProfile()" >Show/Hide Profile</a>
    </div>
    <table id="User_Profile_Area" style="width: 100%">
        <tr>
            <td style="width: 20%" class="colortxt">
                Email Id:
            </td>
            <td class="SmallTxt">
                <asp:label runat="server" id="lblEmailId"></asp:label>
                <input type="text" runat="server" id="tbEmailId" style="display: none" maxlength="50" />
            </td>
        </tr>
        <tr>
            <td class="colortxt">
                Password:
            </td>
            <td class="SmallTxt">
                <asp:label runat="server" id="lblPassword"></asp:label>
                <input type="text" runat="server" id="tbPassword" style="display: none" maxlength="20" />
            </td>
        </tr>
        <tr>
            <td class="colortxt">
                Name:
            </td>
            <td class="SmallTxt">
                <asp:label runat="server" id="lblName"></asp:label>
                <input type="text" runat="server" id="tbName" style="display: none" maxlength="20" />
            </td>
        </tr>
        <tr>
            <td class="colortxt">
                Mobile/Phone No:
            </td>
            <td class="SmallTxt">
                <asp:label runat="server" id="lblPhoneNo"></asp:label>
                <input type="text" runat="server" id="tbPhoneNo" style="display: none" maxlength="50" />
            </td>
        </tr>
        <tr>
            <td class="SmallTxt" colspan="2">&nbsp;
                <asp:label id="lblError" cssclass="error" runat="server"></asp:label>
                <div class="error_message">
                </div>
            </td>
        </tr>
        <tr>
            <td class="SmallTxt" colspan="2">
                <input type="button" class="button" value="Change" id="btnChange" onclick="javascript:return ChangeProfile(true)" />
                <input type="button" class="button" value="Save" id="btnSaveProfile" style="display: none"
                    onclick="javascript:return ValidateUserInfo('Views/User/UserProperty.aspx')" />
                <input type="button" class="button" value="Cancel" id="btnCancel" style="display: none"
                    onclick="javascript:return  ChangeProfile(false)" />
            </td>
        </tr>
    </table>
    <table style="width: 100%">
        <tr>
            <td>
                <a href="#" onclick="javascript:return GetUserProperties('Views/User/UserProperty.aspx?inactive=0')">
                    Active </a><a href="#" onclick="javascript:return GetUserProperties('Views/User/UserProperty.aspx?inactive=1')">
                    InActive </a>
            </td>
            <td>&nbsp;
            </td>
        </tr>
        <tr>
            <td colspan="2">
                <asp:gridview id="grdSearchResults" runat="server" cssclass="gridTable" autogeneratecolumns="False"
                    cellpadding="4" gridlines="None" onrowdatabound="grdSearchResults_RowDataBound">
                <Columns>
                
                <asp:BoundField HeaderText="Sr. No." DataField="SerialNumber" />
                    <%--<asp:BoundField HeaderText="Rent" DataField="Price" />--%>
                    <asp:BoundField HeaderText="Type" DataField="PropertyTypeStr" />
                    <asp:BoundField HeaderText="Usage" DataField="PurposeTypeStr" />
                    <asp:BoundField HeaderText="Location" DataField="Location" />
                    <asp:BoundField HeaderText="Address" DataField="Address" />
                    <%--<asp:BoundField HeaderText="Details" DataField="PropertyDescription" />
                    <%--<asp:TemplateField HeaderText="Contact Details">
                    <ItemTemplate>
                        Name:<asp:Label ID="lblContactName" runat="server" Text='<%#Bind("Name") %>'></asp:Label><br />
                        Contact No: <asp:Label ID="lblContactNo" runat="server" Text='<%#Bind("ContactNo") %>'></asp:Label><br />
                        Email ID:<asp:Label ID="lblEmailId" runat="server" Text='<%#Bind("EmailId")%>'></asp:Label><br />
                        Preferred Time:<asp:Label ID="lblPreferredTime" runat="server" Text='<%#Bind("PreferredTime") %>'></asp:Label><br />
                    </ItemTemplate>
                </asp:TemplateField>--%>
                <asp:TemplateField HeaderText="Edit">
                    <ItemTemplate>
                        <asp:Button ID="btnChangeStatus" width="100px" runat="server" ></asp:Button>
                        <asp:Button ID="btnEdit" Text="Edit" width="100px" runat="server" ></asp:Button>
                    </ItemTemplate>
                </asp:TemplateField>
                </Columns>
                <HeaderStyle CssClass="gridHeader" />
                <RowStyle CssClass="gridTable" />
                <AlternatingRowStyle CssClass="altRow" />
                
            </asp:gridview>
            </td>
        </tr>
        <tr><td><asp:label id="lblResult" cssclass="error" runat="server"></asp:label></td></tr>
        <tr>
            <td align="right">
                <div id="divPageNoFooter" class="pages" runat="server">
                    <span><a href="" runat="server" style="cursor: hand" id="lnkFootFirst" class="first">
                        First</a></span> <span><a style="cursor: hand" runat="server" id="lnkFootPrevious"
                            href="" class="previous">Prev</a></span> <span id="spanFootServerPaging" runat="server"
                                class="nums"></span><span><a href="" runat="server" style="cursor: hand" id="lnkFootNext"
                                    class="next">Next</a></span> <span><a href="" runat="server" id="lnkFootLast" style="cursor: hand"
                                        class="last">Last</a></span>
                </div>
            </td>
        </tr>
    </table>
    
</div>
</form>
